home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DrawPrt2.cpp
-
- Contains: More implementation code for Container.
-
- Owned by: Nick Pilch
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 9/14/95 TJ #included ODSessn.xh, Frame.xh, and
- StorageU.xh so it will compile with out Pre
- Compiled Headers.
- <2> 9/13/95 NP 1269380: Crash with TSMTE and modified
- dialogs.
- <1> 9/13/95 NP first checked in
-
- To Do:
- */
-
- #ifndef _DRWSHARED_
- #include "DrwShared.h"
- #endif
-
-
- #ifndef SOM_Module_OpenDoc_Foci_defined
- #include "Foci.xh"
- #endif
-
-
- #ifndef SOM_ODArbitrator_xh
- #include "Arbitrat.xh"
- #endif
-
- #ifndef SOM_ODWindowState_xh
- #include "WinStat.xh"
- #endif
-
-
- #ifndef _USERSRCM_
- #include "UseRsrcM.h"
- #endif
-
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef SOM_ODSession_xh
- #include <ODSessn.xh>
- #endif
-
- #ifndef SOM_ODFrame_xh
- #include <Frame.xh>
- #endif
-
- #ifndef SOM_ODStorageUnit_xh
- #include <StorageU.xh>
- #endif
-
- #define kTSMTETestDialogID 5057
- #define kOKButton 1
-
- //------------------------------------------------------------------------------
- // BringUpTSMTETestDialog
- //------------------------------------------------------------------------------
-
- void BringUpTSMTETestDialog(Environment* ev, AppleTest_Container* somSelf,
- ODFrame* frame)
- {
- ODSession* session = frame->GetStorageUnit(ev)->GetSession(ev);
-
- // Our About box is modal so we must request the Modal focus to prevent
- // multiple modal dialogs being displayed simultaneously.
-
- if ( session->GetArbitrator(ev)->RequestFocus(ev,
- session->Tokenize(ev, kODModalFocus), frame) )
- {
- ODSShort itemHit;
-
- session->GetWindowState(ev)->DeactivateFrontWindows(ev);
- // Dim the frontmost document window.
-
- ODSLong rfRef;
- rfRef = BeginUsingLibraryResources();
- {
- DialogPtr dialog = GetNewDialog(kTSMTETestDialogID, NULL,
- (WindowPtr)-1L);
- if (!dialog)
- {
- SysBeep(10);
- return;
- }
-
- ShowWindow(dialog);
-
- // ModalFilterUPP otherDialogProc = NewModalFilterProc(OtherDialogFilter);
-
- ODBoolean done = kODFalse;
-
- while (!done)
- {
- ModalDialog(NULL, &itemHit);
-
- switch (itemHit) {
- case kOKButton:
- done = kODTrue;
- break;
-
- default:
- break;
- }
- }
-
- // DisposeRoutineDescriptor(otherDialogProc);
-
- DisposeDialog(dialog);
-
- session->GetArbitrator(ev)->RelinquishFocus(ev,
- session->Tokenize(ev, kODModalFocus), frame);
- // Inform the Arbitrator that we no longer require the Modal
- // focus.
-
- session->GetWindowState(ev)->ActivateFrontWindows(ev);
- // Hilite the frontmost document window.
- }
- EndUsingLibraryResources(rfRef);
- }
- }
-
-